import  time
from public.action import *
from public.testData import *
from public.tools import*
from public.business import *
# 1.点击“点击更新商品索引”按钮，点击“保存索引设置”

testCase33='DBshop033_更新商品索引流程'

firefox=openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
DBshopEnterMenu2(firefox,'商品管理','商品索引')
firefox.find_element_by_xpath('//button[text()="点击更新商品索引"]').click()# 点击更新商品索引
time.sleep(4)
firefox.switch_to.alert.accept()#处理弹窗

firefox.find_element_by_xpath('//button[@type="submit"]').click()#保存索引

string=firefox.find_element_by_xpath('//body').text
print(string)

if  '商品索引设置成功！' in string:  # 用出现的字段断言
    writeLog('%s 测试通过'%testCase33)
else:
    writeLog('%s 测试不通过'%testCase33)
    getPhoto(firefox)


